import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import MyHome from "@/views/MyHome";
import MyMovie from "@/views/MyMovie";
import MyAbout from "@/views/MyAbout";
import MyGoods from '@/views/MyGoods';
import NotFound from "@/views/NotFound";


Vue.use(VueRouter)

Vue.config.productionTip = false

const routes = [
  {
    path: "/",
    redirect: "/home"
  },
  {
    path: "/home",
    component: MyHome
  },
  {
    path: "/movie",
    component: MyMovie
  },
  {
    path: "/about",
    name: "about",
    component: MyAbout
  },
  {
    path: "/goods",
    name: "thegoods",
    component: MyGoods
  },
  {
    path: "/goods/:goodsname",
    component: MyGoods
  },
  {
    path: "*",
    component: NotFound
  }
]

const router = new VueRouter({
  routes,
  mode: "history" // 打包上线后需要后台支持
})

new Vue({
  render: h => h(App),
  router
}).$mount('#app')
